/**
 * 热度分数配置接口
 */
export interface DiscussionHeatScore {
  threshold: number
  color: string
  icon: string
  label: string
}
/**
 * 权重配置接口
 */
export interface DiscussionScoreWeightConfig {
  maxScore: number
  minScore: number
  commentWeight: number
  participantWeight: number
  recencyWeights: DiscussionRecencyWeight[]
  keyPersonWeights: DiscussionKeyPersonWeightConfig
  activeUserBonus: DiscussionActiveUserBonusConfig
}
/**
 * 最近活跃度权重配置
 */
export interface DiscussionRecencyWeight {
  maxHours: number
  score: number
  label: string
}

/**
 * 关键人物权重配置
 */
export interface DiscussionKeyPersonWeightConfig {
  originalPoster: number
  author: number
  admin: number
}

/**
 * 活跃用户额外加分配置
 */
export interface DiscussionActiveUserBonusConfig {
  originalPoster: number
  author: number
  admin: number
}

/**
 * 各维度最大分数限制配置
 */
export interface DiscussionMaxScoreLimits {
  comments: number
  participants: number
  recency: number
  keyPersons: number
}

/**
 * 热度分数分析报告配置
 */
export interface DiscussionScoreAnalysisReport {
  finalScore: number
  scoreBreakdown: {
    baseScore: number
    commentScore: number
    participantScore: number
    recencyScore: number
    keyPersonScore: number
  }
  heatLevel: {
    color: string
    icon: string
    label: string
  }
  config: {
    maxScore: number
    limits: DiscussionMaxScoreLimits
  }
}

/**
 * 热度分数等级配置
 */
export const DISCUSSION_HEAT_SCORE_CONFIG: DiscussionHeatScore[] = [
  { threshold: 50, color: '#a4b0be', icon: '🔹', label: '低温' },
  { threshold: 60, color: '#74b9ff', icon: '🔸', label: '一般' },
  { threshold: 70, color: '#0984e3', icon: '⚡', label: '活跃' },
  { threshold: 80, color: '#00cec9', icon: '🔥', label: '高温' },
  { threshold: 90, color: '#2ed573', icon: '🔥', label: '火热' },
]

/**
 * 最近活跃度权重配置（按时间降序排列）
 */
export const DISCUSSION_RECENCY_WEIGHTS: DiscussionRecencyWeight[] = [
  { maxHours: 1, score: 10, label: '1小时内' },
  { maxHours: 6, score: 8, label: '6小时内' },
  { maxHours: 24, score: 5, label: '24小时内' },
  { maxHours: 24 * 3, score: 3, label: '3天内' },
  { maxHours: 24 * 7, score: 2, label: '1周内' },
  { maxHours: 24 * 30, score: 1, label: '1月内' },
  { maxHours: 24 * 180, score: -5, label: '半年内' },
  { maxHours: 24 * 365, score: -10, label: '1年内' },
  { maxHours: Infinity, score: -15, label: '超过1年' },
]

/**
 * 关键人物权重配置
 */
export const DISCUSSION_KEY_PERSON_WEIGHTS: DiscussionKeyPersonWeightConfig = {
  originalPoster: 1,
  author: 5,
  admin: 3,
}

/**
 * 活跃用户额外加分配置
 */
export const DISCUSSION_ACTIVE_USER_BONUS: DiscussionActiveUserBonusConfig = {
  originalPoster: 8,
  author: 8,
  admin: 3,
}

/**
 * 完整的权重配置
 */
export const DISCUSSION_SCORE_WEIGHT_CONFIG: DiscussionScoreWeightConfig = {
  // 基础配置
  maxScore: 100,
  minScore: 50,

  // 评论数量权重配置
  commentWeight: 0.5, // 每条评论的权重
  participantWeight: 2, // 每个参与者的权重

  // 各维度最大分数限制
  recencyWeights: DISCUSSION_RECENCY_WEIGHTS,
  keyPersonWeights: DISCUSSION_KEY_PERSON_WEIGHTS,
  activeUserBonus: DISCUSSION_ACTIVE_USER_BONUS,
}

/**
 * 各维度最大分数限制
 */
export const DISCUSSION_MAX_SCORE_LIMITS: DiscussionMaxScoreLimits = {
  comments: 15, // 评论数量最大得分
  participants: 15, // 参与人数最大得分
  recency: 10, // 最近活跃度最大得分
  keyPersons: 15, // 关键人物最大得分
}
